import axios from 'axios'


import request from "./request.js"

//post请求接口
export const Post = (url, params) => {
  return new Promise((resolve, reject) => {
    request({
      method: "post",
      url: url,
      data: params || {},
      // headers: {
      //   "Content-Type": "application/json"
      // }
    }).then(res => {
      resolve(res)
    }).catch(err => {
      reject(err)
    })
  })
}
export const Posts = (url, params) => {
  return new Promise((resolve, reject) => {
    request({
      method: "post",
      url: url,
      data: params || {},
      responseType: 'blob'
      // headers: {
      //   "Content-Type": "application/json"
      // }
    }).then(res => {


      resolve(res)
    }).catch(err => {
      reject(err)
    })
  })
}
export const Get = (url, params) => {
  return new Promise((resolve, reject) => {
    request({
      method: "get",
      url: url,
      data: params || {},
      // headers: {
      //   "Content-Type": "application/json"
      // }
    }).then(res => {
      resolve(res)
    }).catch(err => {
      reject(err)
    })
  })
}

// 获取小程序json
export const login = params => {
  return Post(`/admin/login`, params)
};
export const send_code = params => {
  return Post(`/admin/send_code`, params)
};

export const admin_list = params => {
  return Post(`/admin/admin_list`, params)
};
export const user_list = params => {
  return Post(`/admin/user_list`, params)
};
export const refuse = params => {
  return Post(`/admin/refuse`, params)
};
export const pass = params => {
  return Post(`/admin/pass`, params)
};
export const user_details_del = params => {
  return Post(`/admin/user_details_del`, params)
};

export const edit_user_details = params => {
  return Post(`/admin/edit_user_details`, params)
};
export const forget = params => {
  return Post(`/admin/forget`, params)
};
export const log_out = params => {
  return Post(`/admin/log_out`, params)
};

export const group_select = params => {
  return Post(`/admin/group_select`, params)
};
export const user_group_list = params => {
  return Post(`/admin/user_group_list`, params)
};
export const create_user = params => {
  return Post(`/admin/create_admin`, params)
};
export const admin_find = params => {
  return Post(`/admin/admin_find`, params)
};
export const create_group = params => {
  return Post(`/admin/create_group`, params)
};
export const user_create_group = params => {
  return Post(`/admin/user_create_group`, params)
};
export const menu = params => {
  return Post(`/admin/menu`, params)
};
export const user_menu = params => {
  return Post(`/admin/user_menu`, params)
};
export const group_menu1 = params => {
  return Post(`/admin/group_menu`, params)
};
export const user_group_menu = params => {
  return Post(`/admin/user_group_menu`, params)
};
export const user_create_group_menu1 = params => {
  return Post(`/admin/user_create_group_menu`, params)
};
export const create_group_menu1 = params => {
  return Post(`/admin/create_group_menu`, params)
};
export const award_details = params => {
  return Post(`/common/award_details`, params)
};
export const admin_del = params => {
  return Post(`/admin/admin_del`, params)
};
export const group_del = params => {
  return Post(`/admin/group_del`, params)
};
export const user_group_del = params => {
  return Post(`/admin/user_group_del`, params)
};
export const user_details_list = params => {
  return Post(`/admin/user_details_list`, params)
};
export const user_child_details = params => {
  return Post(`/admin/user_child_details`, params)
};
export const submit_audit = params => {
  return Post(`/admin/submit_audit`, params)
};
export const turn_down = params => {
  return Post(`/admin/turn_down`, params)
};
export const innovation_select = params => {
  return Post(`/common/innovation_select`, params)
};
export const check_list = params => {
  return Post(`/admin/check_list`, params)
};
export const user_is_shou = params => {
  return Post(`/admin/user_is_shou`, params)
};
export const user_remark = params => {
  return Post(`/admin/user_remark`, params)
};
export const user_split_remark = params => {
  return Post(`/admin/user_split_remark`, params)
};
export const user_split_is_shou = params => {
  return Post(`/admin/user_split_is_shou`, params)
};
export const statistics = params => {
  return Post(`/admin/statistics`, params)
};
export const create_review = params => {
  return Post(`/admin/create_review`, params)
};
export const review_list = params => {
  return Post(`/admin/review_list`, params)
};
export const review_del = params => {
  return Post(`/admin/review_del`, params)
};
export const review_details = params => {
  return Post(`/admin/review_details`, params)
};
export const user_split_list = params => {
  return Post(`/admin/user_split_list`, params)
};
export const create_user_review = params => {
  return Post(`/admin/create_user_review`, params)
};
export const typeApi = params => {
  return Post(`/common/type`, params)
};
export const user_select = params => {
  return Post(`/common/user_select`, params)
};
export const award_find = params => {
  return Post(`/common/award`, params)
};

export const user_review_list = params => {
  return Post(`/common/user_review_list`, params)
};
export const review_user_del = params => {
  return Post(`/admin/review_user_del`, params)
};
export const review_find = params => {
  return Post(`/common/review_find`, params)
};
export const review_award_list = params => {
  return Post(`/admin/review_award_list`, params)
};
export const is_award = params => {
  return Post(`/admin/is_award`, params)
};
export const review_state = params => {
  return Post(`/admin/review_state`, params)
};
export const user_child_detailst = params => {
  return Post(`/common/user_child_details`, params)
};

export const fz_list = params => {
  return Post(`/admin/fz_list`, params)
};
export const fz_create = params => {
  return Post(`/admin/fz_create`, params)
};
export const fz_del = params => {
  return Post(`/admin/fz_del`, params)
};
export const award_split = params => {
  return Post(`/admin/award_split`, params)
};
export const award_split_create = params => {
  return Post(`/admin/award_split_create`, params)
};
export const fz_details = params => {
  return Post(`/admin/fz_details`, params)
};
export const award_split_del = params => {
  return Post(`/admin/award_split_del`, params)
};
export const fz_select = params => {
  return Post(`/common/fz_select`, params)
};
export const file_download = params => {
  return Posts(`/common/2022/file_download`, params,)
};
export const searchIndex = params => {
  return Post(`/admin/2022/search/index`, params,)
};
export const set_user_num = params => {
  return Post(`/admin/2022/user/set_user_num`, params,)
};
export const importS = params => {
  return Post(`/common/2022/import`, params,)
};
export const add = params => {
  return Post(`/admin/2022/user/create_user`, params,)
};
export const turn_downs = params => {
  return Post(`/admin/2022/user/turn_down`, params,)
};
